//InterfaceTest.java
package com.ylaihui.oop12;

interface Moveable{
	public static final int MIN_SPEED = 0;
	int MAX_SPEED = 150;  // 省略了 public static final
	
	public abstract void move();
	void stop(); // 省略 public abstract 
	
	// Interfaces cannot have constructors
//	Moveable(){
//		
//	}
}

class Person implements Moveable{
	@Override
	public void move() {
		System.out.println("Person walk...");
	}

	@Override
	public void stop() {
		System.out.println("Person stop...");		
	}
}

// 只实现了接口中的部分抽象方法，那么本类要定义为 abstract
abstract class Animal implements Moveable{
	@Override
	public void move() {
		
	}	
}

public class InterfaceTest {
	public static void main(String[] args) {
		System.out.println(Moveable.MAX_SPEED);
		System.out.println(Moveable.MIN_SPEED);
		
//		Moveable.MIN_SPEED = 100; // The final field Moveable.MIN_SPEED cannot be assigned
		Person person = new Person();
		
	}
}
